//
//  VK_Picker.h
//  HealthyLife
//
//  Created by Vescky on 12-12-17.
//  Copyright (c) 2012年 Vescky. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol VK_PickerDelegate <NSObject>

@optional

-(void)VK_PickerLeftButtonEvent;

-(void)VK_PickerRightButtonEvent;

- (void)VK_labelShowEvent;

@end

@interface VK_Picker : UIViewController <UIPickerViewDataSource,UIPickerViewDelegate> {
    NSMutableArray *dayForPicker;
    bool setDateAnimate;
    IBOutlet UIImageView *bgImageView;
    int maxYear,maxMonth,maxDay;
    int minYear,minMonth,minDay;
    bool isLimitDate;
}

//------需设置的属性---------
#pragma mark - 设置Picker
@property (nonatomic,retain) NSMutableArray *pickerViewData;//pickerViewData结构:{array,array,...}

@property (nonatomic,retain) NSDate *dateTime;//设置日期

@property (nonatomic,retain) NSMutableArray *cycleData;//循环显示数据

@property (nonatomic,retain) UIImage *bgImage;

@property bool banLayerLayout;//圆角的默认风格

@property (nonatomic,retain) NSDate *maxDate,*minDate;//尚未完成

//--------可以使用、获取的属性---------
#pragma mark - 使用、获取的属性
@property (nonatomic,retain) IBOutlet UIPickerView *pickerVK;

@property (nonatomic,retain) IBOutlet UIButton *buttonLeft,*buttonRight;

@property (nonatomic,retain) IBOutlet UILabel *labelTop;

@property (readonly) int componentOfPicker;//picker的列数

@property int pickerType;

@property int selectedIndex,selectedComponent;

@property (nonatomic,retain) NSDate *selectDate;//使用picker为时间picker才有返回值,否则返回当前时间

@property (nonatomic,retain) id <VK_PickerDelegate> delegate;

//默认生成picker的种类
@property enum DefaultPickerType
{
    Custom,//自定义，不生成
    TimePickerHH_mm,
    TimePickerHH_mm_ss,
    DatePickeryyyy_MM_dd
};


/*-------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------接口--------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------*/
#pragma mark - 接口
- (void)initWithType:(int)_type;

- (void)createPicker:(int)_pickerType;//生成默认picker

- (void)setSelectedRowWithContents:(NSString*)_contents inComponents:(int)_component animated:(bool)_animated; //设置选中行列

- (void)initDate:(NSDate*)_date withAnimate:(bool)_animate;//设置日期方法

- (IBAction)btnLeftAction:(id)sender;

- (IBAction)btnRightAction:(id)sender;

@end
